﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Ovvio.Web.Core;
using Ovvio.Data;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel;

namespace Ovvio.Web.Areas.Admin.Models
{
    public class PromoModel : BaseModel<Promo>
    {
        
        [ScaffoldColumn(false)]
        public int Id { get { return Entity.Id; } set { Entity.Id = value;  } }

        [Required]
        public string Name { get { return Entity.Name; } set { Entity.Name = value; } }

        [Required]
        [UIHint("DescriptionUserControl")]
        public string Description { get { return Entity.Description; } set { Entity.Description = value; } }

        [DataType( DataType.Date)]
        [DisplayName("Start")]
        public DateTime DateStart { get { return Entity.DateStart.HasValue ? Entity.DateStart.Value : DateTime.Now; } set { Entity.DateStart = value; } }

        [DataType(DataType.Date)]
        [DisplayName("End")]
        public DateTime DateEnd { get { return Entity.DateEnd.HasValue ? Entity.DateStart.Value : DateTime.Now; } set { Entity.DateEnd = value; } }
        
    }
}
